<template>
  <el-form :inline="true" :model="form" label-width="100" class="search-form">
    <el-row :gutter="20">
      <el-col :xs="24" :sm="12" :lg="8":xl="6">
        <el-form-item label="订单号：">
          <el-input v-model="form.publicName" clearable placeholder="请输入" />
        </el-form-item>
      </el-col>
      <el-col :xs="24" :sm="12" :lg="8":xl="6">
        <el-form-item label="托运人：">
          <el-input v-model="form.publicName" clearable placeholder="请输入" />
        </el-form-item>
      </el-col>
      <el-col :xs="24" :sm="12" :lg="8":xl="6">
        <el-form-item label="发货时间：">
          <el-input v-model="form.publicName" clearable placeholder="请输入" />
        </el-form-item>
      </el-col>
      <el-col :xs="24" :sm="12" :lg="8":xl="6">
        <el-form-item label="订单状态：">
          <el-select v-model="form.systemFlag" placeholder="请选择" clearable>
            <el-option v-for="(item,index) in optionData.dictType" :key="index" :label="item.name" :value="item.id" />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :xs="24" :sm="12" :lg="8":xl="6">
        <el-form-item label="承运人：">
          <el-input v-model="form.publicName" clearable placeholder="请输入" />
        </el-form-item>
      </el-col>
      <el-col :xs="24" :sm="12" :lg="8":xl="6">
        <el-form-item label="承运商：">
          <el-input v-model="form.publicName" clearable placeholder="请输入" />
        </el-form-item>
      </el-col>
      <el-col :xs="24" :sm="12" :lg="8":xl="6">
        <el-form-item label="发货城市：">
          <el-select v-model="form.systemFlag" placeholder="请选择" clearable>
            <el-option v-for="(item,index) in optionData.dictType" :key="index" :label="item.name" :value="item.id" />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :xs="24" :sm="12" :lg="8":xl="6">
        <el-form-item label="收货城市：">
          <el-select v-model="form.systemFlag" placeholder="请选择" clearable>
            <el-option v-for="(item,index) in optionData.dictType" :key="index" :label="item.name" :value="item.id" />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :xs="24" :sm="12" :lg="8":xl="6">
        <el-form-item label="创建时间：">
          <el-input v-model="form.publicName" clearable placeholder="请输入" />
        </el-form-item>
      </el-col>
      <el-col :xs="24" :sm="12" :lg="8":xl="6">
        <el-form-item label="运输方式：">
          <el-select v-model="form.systemFlag" placeholder="请选择" clearable>
            <el-option v-for="(item,index) in optionData.dictType" :key="index" :label="item.name" :value="item.id" />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :xs="24" :sm="12" :lg="8":xl="6">
        <el-form-item label="">
          <el-button type="primary" @click="toSearch()">搜索</el-button>
          <el-button type="default" @click="toSearch('reset')">重置</el-button>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script setup lang="ts">
import { useSearch } from '/@/assets/compositionFn/search';
const emit = defineEmits(['confirm']);
let searchForm = {
  publicName: null,
  systemFlag: null,
};
const { form, optionData, isReset } = useSearch(searchForm);

const toSearch = (type?:any)=>{
  isReset(type);
  emit('confirm');
};
defineExpose({
  form,
  toSearch
})
</script>

<style>

</style>